﻿
namespace Indeco.G24.Windows.Forms
{
	/// <summary>
	/// abstract NgoaiTe typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class NgoaiTeDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<NgoaiTeDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.NgoaiTe _currentNgoaiTe = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxNgoaiTeDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxNgoaiTeErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxNgoaiTeBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the IDNgoaiTe property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDNgoaiTeDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the KyHieu property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxKyHieuDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Ten property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxTenDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the TyGia property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxTyGiaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MacDinh property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxMacDinhDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the TrangThai property
		/// </summary>
		protected System.Windows.Forms.DataGridViewCheckBoxColumn uxTrangThaiDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the HinhMinhHoa property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxHinhMinhHoaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ThoiDiemChinhSua property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxThoiDiemChinhSuaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ThoiDiemCapNhat property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxThoiDiemCapNhatDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.NgoaiTe> _NgoaiTeList;
				
		/// <summary> 
		/// The list of NgoaiTe to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.NgoaiTe> NgoaiTeList
		{
			get {return this._NgoaiTeList;}
			set
			{
				this._NgoaiTeList = value;
				this.uxNgoaiTeBindingSource.DataSource = null;
				this.uxNgoaiTeBindingSource.DataSource = value;
				this.uxNgoaiTeDataGridView.DataSource = null;
				this.uxNgoaiTeDataGridView.DataSource = this.uxNgoaiTeBindingSource;				
				//this.uxNgoaiTeBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxNgoaiTeBindingSource_ListChanged);
				this.uxNgoaiTeBindingSource.CurrentItemChanged += new System.EventHandler(OnNgoaiTeBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnNgoaiTeBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentNgoaiTe = uxNgoaiTeBindingSource.Current as Entities.NgoaiTe;
			
			if (_currentNgoaiTe != null)
			{
				_currentNgoaiTe.Validate();
			}
			//_NgoaiTe.Validate();
			OnCurrentEntityChanged();
		}

		//void uxNgoaiTeBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.NgoaiTe"/> instance.
		/// </summary>
		public Entities.NgoaiTe SelectedNgoaiTe
		{
			get {return this._currentNgoaiTe;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxNgoaiTeDataGridView.VirtualMode;}
			set
			{
				this.uxNgoaiTeDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxNgoaiTeDataGridView.AllowUserToAddRows;}
			set {this.uxNgoaiTeDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxNgoaiTeDataGridView.AllowUserToDeleteRows;}
			set {this.uxNgoaiTeDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxNgoaiTeDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxNgoaiTeDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="NgoaiTeDataGridViewBase"/> class.
		/// </summary>
		public NgoaiTeDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxNgoaiTeDataGridView = new System.Windows.Forms.DataGridView();
			this.uxNgoaiTeBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxNgoaiTeErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDNgoaiTeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxKyHieuDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxTenDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxTyGiaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxMacDinhDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxTrangThaiDataGridViewColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
			this.uxHinhMinhHoaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxThoiDiemChinhSuaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxThoiDiemCapNhatDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			((System.ComponentModel.ISupportInitialize)(this.uxNgoaiTeDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNgoaiTeBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNgoaiTeErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxNgoaiTeErrorProvider
			// 
			this.uxNgoaiTeErrorProvider.ContainerControl = this;
			this.uxNgoaiTeErrorProvider.DataSource = this.uxNgoaiTeBindingSource;						
			// 
			// uxNgoaiTeDataGridView
			// 
			this.uxNgoaiTeDataGridView.AutoGenerateColumns = false;
			this.uxNgoaiTeDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxNgoaiTeDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDNgoaiTeDataGridViewColumn,
		this.uxKyHieuDataGridViewColumn,
		this.uxTenDataGridViewColumn,
		this.uxTyGiaDataGridViewColumn,
		this.uxMacDinhDataGridViewColumn,
		this.uxTrangThaiDataGridViewColumn,
		this.uxHinhMinhHoaDataGridViewColumn,
		this.uxThoiDiemChinhSuaDataGridViewColumn,
		this.uxThoiDiemCapNhatDataGridViewColumn			});
			this.uxNgoaiTeDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxNgoaiTeDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxNgoaiTeDataGridView.Name = "uxNgoaiTeDataGridView";
			this.uxNgoaiTeDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxNgoaiTeDataGridView.TabIndex = 0;	
			this.uxNgoaiTeDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxNgoaiTeDataGridView.EnableHeadersVisualStyles = false;
			this.uxNgoaiTeDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnNgoaiTeDataGridViewDataError);
			this.uxNgoaiTeDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnNgoaiTeDataGridViewCellValueNeeded);
			this.uxNgoaiTeDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnNgoaiTeDataGridViewCellValuePushed);
			
			//
			// uxIDNgoaiTeDataGridViewColumn
			//
			this.uxIDNgoaiTeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDNgoaiTeDataGridViewColumn.DataPropertyName = "IDNgoaiTe";
			this.uxIDNgoaiTeDataGridViewColumn.HeaderText = "IDNgoaiTe";
			this.uxIDNgoaiTeDataGridViewColumn.Name = "uxIDNgoaiTeDataGridViewColumn";
			this.uxIDNgoaiTeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDNgoaiTeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDNgoaiTeDataGridViewColumn.ReadOnly = false;		
			//
			// uxKyHieuDataGridViewColumn
			//
			this.uxKyHieuDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxKyHieuDataGridViewColumn.DataPropertyName = "KyHieu";
			this.uxKyHieuDataGridViewColumn.HeaderText = "KyHieu";
			this.uxKyHieuDataGridViewColumn.Name = "uxKyHieuDataGridViewColumn";
			this.uxKyHieuDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxKyHieuDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxKyHieuDataGridViewColumn.ReadOnly = false;		
			//
			// uxTenDataGridViewColumn
			//
			this.uxTenDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxTenDataGridViewColumn.DataPropertyName = "Ten";
			this.uxTenDataGridViewColumn.HeaderText = "Ten";
			this.uxTenDataGridViewColumn.Name = "uxTenDataGridViewColumn";
			this.uxTenDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxTenDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxTenDataGridViewColumn.ReadOnly = false;		
			//
			// uxTyGiaDataGridViewColumn
			//
			this.uxTyGiaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxTyGiaDataGridViewColumn.DataPropertyName = "TyGia";
			this.uxTyGiaDataGridViewColumn.HeaderText = "TyGia";
			this.uxTyGiaDataGridViewColumn.Name = "uxTyGiaDataGridViewColumn";
			this.uxTyGiaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxTyGiaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxTyGiaDataGridViewColumn.ReadOnly = false;		
			//
			// uxMacDinhDataGridViewColumn
			//
			this.uxMacDinhDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMacDinhDataGridViewColumn.DataPropertyName = "MacDinh";
			this.uxMacDinhDataGridViewColumn.HeaderText = "MacDinh";
			this.uxMacDinhDataGridViewColumn.Name = "uxMacDinhDataGridViewColumn";
			this.uxMacDinhDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMacDinhDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMacDinhDataGridViewColumn.ReadOnly = false;		
			//
			// uxTrangThaiDataGridViewColumn
			//
			this.uxTrangThaiDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxTrangThaiDataGridViewColumn.DataPropertyName = "TrangThai";
			this.uxTrangThaiDataGridViewColumn.HeaderText = "TrangThai";
			this.uxTrangThaiDataGridViewColumn.Name = "uxTrangThaiDataGridViewColumn";
			this.uxTrangThaiDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxTrangThaiDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxTrangThaiDataGridViewColumn.ReadOnly = false;		
			//
			// uxHinhMinhHoaDataGridViewColumn
			//
			this.uxHinhMinhHoaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxHinhMinhHoaDataGridViewColumn.DataPropertyName = "HinhMinhHoa";
			this.uxHinhMinhHoaDataGridViewColumn.HeaderText = "HinhMinhHoa";
			this.uxHinhMinhHoaDataGridViewColumn.Name = "uxHinhMinhHoaDataGridViewColumn";
			this.uxHinhMinhHoaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxHinhMinhHoaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxHinhMinhHoaDataGridViewColumn.ReadOnly = false;		
			//
			// uxThoiDiemChinhSuaDataGridViewColumn
			//
			this.uxThoiDiemChinhSuaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxThoiDiemChinhSuaDataGridViewColumn.DataPropertyName = "ThoiDiemChinhSua";
			this.uxThoiDiemChinhSuaDataGridViewColumn.HeaderText = "ThoiDiemChinhSua";
			this.uxThoiDiemChinhSuaDataGridViewColumn.Name = "uxThoiDiemChinhSuaDataGridViewColumn";
			this.uxThoiDiemChinhSuaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxThoiDiemChinhSuaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxThoiDiemChinhSuaDataGridViewColumn.ReadOnly = false;		
			//
			// uxThoiDiemCapNhatDataGridViewColumn
			//
			this.uxThoiDiemCapNhatDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxThoiDiemCapNhatDataGridViewColumn.DataPropertyName = "ThoiDiemCapNhat";
			this.uxThoiDiemCapNhatDataGridViewColumn.HeaderText = "ThoiDiemCapNhat";
			this.uxThoiDiemCapNhatDataGridViewColumn.Name = "uxThoiDiemCapNhatDataGridViewColumn";
			this.uxThoiDiemCapNhatDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxThoiDiemCapNhatDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxThoiDiemCapNhatDataGridViewColumn.ReadOnly = false;		
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxNgoaiTeDataGridView);
			this.Name = "NgoaiTeDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			((System.ComponentModel.ISupportInitialize)(this.uxNgoaiTeErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNgoaiTeDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxNgoaiTeBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				NgoaiTeDataGridViewEventArgs args = new NgoaiTeDataGridViewEventArgs();
				args.NgoaiTe = _currentNgoaiTe;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class NgoaiTeDataGridViewEventArgs : System.EventArgs
		{
			private Entities.NgoaiTe	_NgoaiTe;
	
			/// <summary>
			/// the  Entities.NgoaiTe instance.
			/// </summary>
			public Entities.NgoaiTe NgoaiTe
			{
				get { return _NgoaiTe; }
				set { _NgoaiTe = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxNgoaiTeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnNgoaiTeDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxNgoaiTeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnNgoaiTeDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxNgoaiTeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDNgoaiTeDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].IDNgoaiTe;
						break;
					case "uxKyHieuDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].KyHieu;
						break;
					case "uxTenDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].Ten;
						break;
					case "uxTyGiaDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].TyGia;
						break;
					case "uxMacDinhDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].MacDinh;
						break;
					case "uxTrangThaiDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].TrangThai;
						break;
					case "uxHinhMinhHoaDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].HinhMinhHoa;
						break;
					case "uxThoiDiemChinhSuaDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].ThoiDiemChinhSua;
						break;
					case "uxThoiDiemCapNhatDataGridViewColumn":
						e.Value = NgoaiTeList[e.RowIndex].ThoiDiemCapNhat;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxNgoaiTeDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnNgoaiTeDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxNgoaiTeDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDNgoaiTeDataGridViewColumn":
						NgoaiTeList[e.RowIndex].IDNgoaiTe = (System.Guid)e.Value;
						break;
					case "uxKyHieuDataGridViewColumn":
						NgoaiTeList[e.RowIndex].KyHieu = (System.String)e.Value;
						break;
					case "uxTenDataGridViewColumn":
						NgoaiTeList[e.RowIndex].Ten = (System.String)e.Value;
						break;
					case "uxTyGiaDataGridViewColumn":
						NgoaiTeList[e.RowIndex].TyGia = (System.Double)e.Value;
						break;
					case "uxMacDinhDataGridViewColumn":
						NgoaiTeList[e.RowIndex].MacDinh = (System.Boolean)e.Value;
						break;
					case "uxTrangThaiDataGridViewColumn":
						NgoaiTeList[e.RowIndex].TrangThai = (System.Boolean)e.Value;
						break;
					case "uxHinhMinhHoaDataGridViewColumn":
						NgoaiTeList[e.RowIndex].HinhMinhHoa = (System.String)e.Value;
						break;
					case "uxThoiDiemChinhSuaDataGridViewColumn":
						NgoaiTeList[e.RowIndex].ThoiDiemChinhSua = (System.DateTime)e.Value;
						break;
					case "uxThoiDiemCapNhatDataGridViewColumn":
						NgoaiTeList[e.RowIndex].ThoiDiemCapNhat = (System.DateTime)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
